package com.szholly.pro.watergas_server.common.data;

import java.util.HashMap;

public class DataInterceptorManager {
	
	private static DataInterceptorManager _instance;
	
	private HashMap<String, IDataInterceptor> dataInterceptorMap = new HashMap<>();
	
	public static DataInterceptorManager getInstance(){
		if(_instance == null){
			_instance = new DataInterceptorManager();
		}
		return _instance;
	}
	
	public void add(String tableName,IDataInterceptor interceptor){
		dataInterceptorMap.put(tableName, interceptor);
	}
	
	public IDataInterceptor get(String tableName){
		return dataInterceptorMap.get(tableName);
	}
	
	public boolean hasInterceptor(String tableName){
		boolean result = dataInterceptorMap.containsKey(tableName);
		return result;
	}
	
	public void init(){
	}
	
}
